package com.atguigu.bigdata.scala.chapter02

import scala.io.{BufferedSource, Source}

object Scala06_In_1 {

    def main(args: Array[String]): Unit = {

        // TODO In
        // 文件输入 : 需要指明文件的路径
        // 绝对路径
        val source: BufferedSource = Source.fromFile("C:\\Users\\WangJinGen\\IdeaProjects\\a.txt")
        val lines: Iterator[String] = source.getLines()
        while ( lines.hasNext ) {
            val line = lines.next()
            println(line)
        }
        source.close()
    }
}
